---
title: "Replication material for Beyond the Myth of Legality? Framing Effects and Public Reactions to High Court Decisions in Europe"
output: html_document
---

```{r setup}
knitr::opts_chunk$set(echo = TRUE, dpi = 300,  dev='png', fig.path = "figures/")
#add path here
```


```{r, warning=FALSE, message=FALSE}
# packages ----------------------------------------------------------------
library(tidyverse)
library(broom)
library(readstata13)
library(survey)
library(srvyr)
library(jtools)
library(socviz)
library(stargazer)
library(mediation)
library(summarytools)
library(patchwork)
library(infer)
library(interactions)
library(mice)
```

## Portuguese data
```{r, warning=FALSE, message=FALSE}
por_df <- readRDS("por_df.Rda")
```

### Frames
```{r, warning=FALSE, message=FALSE}
#Recode frames 
por_df <- por_df %>%
  mutate(frames = case_when(
    frames == 1 ~ "Legalistic",
    frames == 2 ~ "Policy",
    frames == 3 ~ "Partisan"
  ))

#Convert frames to factor and relevel
por_df <- por_df %>%
  mutate(frames = factor(frames,
                         levels = c("Partisan",
                                    "Legalistic",
                                    "Policy")))

```

### Outcome
```{r, warning=FALSE, message=FALSE}
por_df <- por_df %>%
  mutate(
    outcome_char = case_when(
      outcome == 1 ~ "Constitutional, eliminate fees",
      outcome == 2 ~ "Unconstitutional, preserve fees"
    )
  )
```

### Outcome favorability
```{r, warning=FALSE, message=FALSE}
#Generate outcome favorability
por_df <- por_df %>%
  mutate(
    favorable_outcome = case_when(
      outcome == 1 &
        feesopinion %in% 1:5 |
        outcome == 2 & feesopinion %in% 6:10 ~ "Favorable outcome",
      outcome == 1 &
        feesopinion %in% 6:10 |
        outcome == 2 & feesopinion %in% 1:5 ~ "Unfavorable outcome"
    )
  )

#Convert favorable outcome to factor and relevel
por_df <- por_df %>%
  mutate(favorable_outcome = factor(favorable_outcome,
                   levels = c("Unfavorable outcome",
                              "Favorable outcome")))
```

## Norwegian data
```{r, warning=FALSE, message=FALSE}

nor_df <- readRDS("nor_df.Rda")

# rename variables
nor_df <- nor_df %>% 
  rename(id = responseid,
         opinion = r19pad9,
         Legalistic = r19pad10a,
         Policy = r19pad10b, 
         Partisan = r19pad10c,
         noviolation = r19pad11a, 
         violation = r19pad11b
         )

# subset observations to our sample
nor_df <- nor_df %>% 
  filter(!is.na(r19pad10_ran))

# recode missing observations on fairness and acceptability
nor_df <- nor_df %>% 
  mutate(Legalistic = ifelse(Legalistic %in% 1:10, Legalistic, NA),
         Policy = ifelse(Policy %in% 1:10, Policy, NA),
         Partisan = ifelse (Partisan %in% 1:10, Partisan, NA),
         noviolation = ifelse(noviolation %in% 1:10, noviolation, NA),
         violation = ifelse(violation %in% 1:10, violation, NA))

# fairness equals score in legalistic if r9pad10_ran == 1, Policy if r9pad10_ran == 2, partisan if r9pad10_ran == 3
nor_df <- nor_df %>% 
  mutate(fairness = ifelse(r19pad10_ran == 1, Legalistic,
                           ifelse(r19pad10_ran == 2, Policy, Partisan)))

# acceptability equals score in noviolation if r19pad11_ran == 1, violation if r19pad11_ran == 2
nor_df <- nor_df %>% 
  mutate(acceptability = ifelse(r19pad11_ran == 1, noviolation, violation))
                           
```


### Frames
```{r, warning=FALSE, message=FALSE}

#Recode frames
nor_df <- nor_df %>% 
  mutate(frames = case_when(r19pad10_ran == 1 ~ "Legalistic",
                            r19pad10_ran == 2 ~ "Policy",
                            r19pad10_ran == 3 ~ "Partisan"))

#Convert frames to factor and relevel
nor_df <- nor_df %>%
  mutate(frames = factor(frames,
                         levels = c("Partisan",
                                    "Legalistic",
                                    "Policy")))
```


### Outcome
```{r, warning=FALSE, message=FALSE}

#Outcome
nor_df <- nor_df %>% 
  mutate(outcome = case_when(r19pad11_ran == 1 ~ "Constitutional",
                             r19pad11_ran == 2 ~ "Unconstitutional"))

```

### Outcome favorability
```{r, warning=FALSE, message=FALSE}

#Generate outcome favorability ------------------------------------------
nor_df <- nor_df %>%
  mutate(
    favorable_outcome = case_when(
      outcome == "Constitutional" &
        opinion == 1 |
        outcome == "Unconstitutional" & opinion == 2 ~ "Favorable outcome",
      outcome == "Constitutional" &
        opinion == 2 |
        outcome == "Unconstitutional"  & opinion == 1 ~ "Unfavorable outcome"
    )
  )

#Convert favorable outcome to factor and relevel
nor_df <- nor_df %>%
  mutate(favorable_outcome = factor(favorable_outcome,
                                    levels = c("Unfavorable outcome",
                                               "Favorable outcome")))

```

## Main results
### Testing H1: Two-Sample t-Test for Equal Means in Perceived Fairness (comparing respondents exposed to legalistic and partisan frames). 

```{r, warning=FALSE, message=FALSE}
#Portugal
por_df_h1 <- por_df %>% 
  filter(frames == "Legalistic"|frames == "Partisan")

t_test(x = por_df_h1, formula = fairness ~ frames, order = c("Legalistic", "Partisan"), alternative = "two-sided")

#To get difference in means
round(por_df_h1 %>% specify(fairness ~ frames) %>% calculate("diff in means", order = c("Legalistic", "Partisan")), digits = 2)
```


```{r, warning=FALSE, message=FALSE}
#Norway
nor_df_h1 <- nor_df %>%
  filter(frames == "Legalistic"|frames == "Partisan")

t_test(x = nor_df_h1, formula = fairness ~ frames, order = c("Legalistic", "Partisan"), alternative = "two-sided")

#To get difference in means
round(nor_df_h1 %>% specify(fairness ~ frames) %>% calculate("diff in means", order = c("Legalistic", "Partisan")), digits = 2)

```

### Testing H3: Two-Sample t-Test for Equal Means in Perceived Fairness (comparing respondents exposed to legalistic and Policy frames). 
```{r, warning=FALSE, message=FALSE}
#Portugal
por_df_h3 <- por_df %>% 
  filter(frames == "Legalistic"|frames == "Policy")

t_test(x = por_df_h3, formula = fairness ~ frames, order = c("Legalistic", "Policy"), alternative = "two-sided")
#To get difference in means
round(por_df_h3 %>% specify(fairness ~ frames) %>% calculate("diff in means", order = c("Legalistic", "Policy")), digits = 2)
```


```{r, warning=FALSE, message=FALSE}
#Norway
nor_df_h3 <- nor_df %>%
  filter(frames == "Legalistic"|frames == "Policy")

t_test(x = nor_df_h3, formula = fairness ~ frames, order = c("Legalistic", "Policy"), alternative = "two-sided")
#To get difference in means
round(nor_df_h3 %>% specify(fairness ~ frames) %>% calculate("diff in means", order = c("Legalistic", "Policy")), digits = 2)
```

### Testing H5: Two-Sample t-Test for Equal Means in Perceived Fairness (comparing respondents exposed to Policy and partisan frames).
```{r, warning=FALSE, message=FALSE}
#Portugal
por_df_h5 <- por_df %>% 
  filter(frames == "Partisan"|frames == "Policy")

t_test(x = por_df_h5, formula = fairness ~ frames, order = c("Policy", "Partisan"), alternative = "two-sided")

#To get difference in means
round(por_df_h5 %>% specify(fairness ~ frames) %>% calculate("diff in means", order = c("Policy", "Partisan")), digits = 2)
```


```{r, warning=FALSE, message=FALSE}
#Norway
nor_df_h5 <- nor_df %>%
  filter(frames == "Partisan"|frames == "Policy")

t_test(x = nor_df_h5, formula = fairness ~ frames, order = c("Policy", "Partisan"), alternative = "two-sided")

#To get difference in means
round(nor_df_h5 %>% specify(fairness ~ frames) %>% calculate("diff in means", order = c("Policy", "Partisan")), digits = 2)
```

### Make Figure 2
```{r, warning=FALSE, message=FALSE}

#Portugal
por_df_srvyr <- por_df %>% 
  as_survey_design(ids = id)

por_df_srvyr_summary <- por_df_srvyr %>%
  group_by(frames) %>%
  summarize(fairness = survey_mean(fairness, vartype = "ci", na.rm = T))

dodge <- position_dodge(width=0.7)

por_h1h3 <- por_df_srvyr %>%
  group_by(frames) %>%
  summarize(fairness = survey_mean(fairness, vartype = "ci", na.rm = T)) %>%
  ggplot(
    mapping = aes(
      x = reorder(frames, fairness),
      y = fairness,
      ymin = fairness_low,
      ymax = fairness_upp,
      fill = frames,
      color = frames
    )
  ) +
  geom_col(position = dodge, 
           color = "black"
           ) +
  geom_errorbar(position = dodge, color = "black", width = 0.1) +
  scale_fill_manual(values=c("#FFFFFF", "#FFFFFF", "#FFFFFF")) +
  scale_y_continuous(
    breaks = c(1:10),
    expand = c(0, -1),
    limits=c(0,11)
    ) +
  labs(x = "(a) Portugal (n = 890)", y = "Fairness perceptions (scale 1-10)") +
  theme_minimal() +
  theme(legend.position = "none",
         axis.line = element_line())


#Norway

nor_df_srvyr <- nor_df %>% 
  as_survey_design(ids = id)

nor_df_srvyr_summary <- nor_df_srvyr %>%
  group_by(frames) %>%
  summarize(fairness = survey_mean(fairness, vartype = "ci", na.rm = T))

nor_h1h3 <- nor_df_srvyr %>%
  group_by(frames) %>%
  summarize(fairness = survey_mean(fairness, vartype = "ci", na.rm = T)) %>%
  ggplot(
    mapping = aes(
      x = reorder(frames, fairness),
      y = fairness,
      ymin = fairness_low,
      ymax = fairness_upp,
      fill = frames,
      color = frames
    )
  ) +
  geom_col(position = dodge,
           color = "black"
           ) +
  geom_errorbar(position = dodge, color = "black", width = 0.1) +
  scale_x_discrete(labels = scales::wrap_format(10)) +
  scale_fill_manual(values=c("#FFFFFF", "#FFFFFF", "#FFFFFF")) +
  scale_y_continuous(
    breaks = c(1:10),
    expand = c(0, -1),
    limits=c(0,11)
    ) +
  labs(x = "(b) Norway (n = 1896)", y = "") +
  theme_minimal() +
  theme(legend.position = "none",
        axis.line = element_line())

```
### Plot Figure 2
``` {r fairness, echo=FALSE, dpi=300, fig.width=6, fig.height=4, fig.cap = "Mean fairness perceptions among (a) Portuguese and (b) Norwegian citizens exposed to partisan, legalistic and policy portrayals of judicial decision-making. 95% confidence intervals enclose the estimates."}

por_h1h3 + nor_h1h3

```

### Testing H2, H4, H6, H8
```{r, warning=FALSE, message=FALSE}

#Portugal
por_lm_acceptability <- lm(acceptability ~ frames + favorable_outcome, data = por_df)
por_tidy_acceptability <- tidy(por_lm_acceptability, conf.int = TRUE)

#Test H4 directly
por_lm_h4 <- lm(acceptability ~ frames + favorable_outcome, data = por_df[por_df$frames != 'Partisan',])
por_h4_tidy <- tidy(por_lm_h4, conf.int = TRUE)

#Norway
nor_lm_acceptability <- lm(acceptability ~ frames + favorable_outcome, data = nor_df)
nor_tidy_acceptability <- tidy(nor_lm_acceptability, conf.int = TRUE)

#Test H4 directly
nor_lm_h4 <- lm(acceptability ~ frames + favorable_outcome, data = nor_df[nor_df$frames != 'Partisan',])
nor_h4_tidy <- tidy(nor_lm_h4, conf.int = TRUE)

```

### Make Figure 3
```{r, warning=FALSE, message=FALSE}
# Portugal
# remove prefix frames and favorable outcome
por_tidy_acceptability <- subset(por_tidy_acceptability, term %nin% "(Intercept)")
por_tidy_acceptability$nicelabs <- prefix_strip(por_tidy_acceptability$term, "frames|favorable_outcome")

por_tidy_acceptability <- por_tidy_acceptability %>%
  mutate(nicelabs = case_when(nicelabs == "Legalistic" ~ "Legalistic Frame",
                   nicelabs == "Policy" ~ "Policy Frame",
                   nicelabs == "Favorable Outcome" ~ "Favorable Outcome"))

# Norway
nor_tidy_acceptability <- subset(nor_tidy_acceptability, term %nin% "(Intercept)")
nor_tidy_acceptability$nicelabs <- prefix_strip(nor_tidy_acceptability$term, "frames|favorable_outcome")

nor_tidy_acceptability <- nor_tidy_acceptability %>%
  mutate(nicelabs = case_when(nicelabs == "Legalistic" ~ "Legalistic Frame",
                   nicelabs == "Policy" ~ "Policy Frame",
                   nicelabs == "Favorable Outcome" ~ "Favorable Outcome"))
```


### Plot Figure 3

```{r acceptability, echo=FALSE, dpi=300, fig.width=6, fig.height=4, fig.cap = "The effects of framing (partisan as reference group) and outcome (unfavorable outcome as reference group) on acceptability perceptions (1= “completely unacceptable”, 10= “completely acceptable”) among Portuguese and Norwegian citizens. 95% confidence intervals enclose the OLS estimates."}

#Make country labels
por_tidy_acceptability <- por_tidy_acceptability %>%
  mutate(country = "Portugal (n = 954)")

nor_tidy_acceptability <- nor_tidy_acceptability %>%
  mutate(country = "Norway (n = 1858)")

tidy_both <- rbind(por_tidy_acceptability, nor_tidy_acceptability)

#Order: legalistic, Policy, favorable outcome

tidy_both <- tidy_both %>%
  mutate(order = case_when(
    nicelabs == "Legalistic Frame" ~ 1,
    nicelabs == "Policy Frame" ~ 2,
    nicelabs == "Favorable Outcome" ~ 3
  ))

#Plot Figure 3

ggplot(tidy_both,
       mapping = aes(
         x = reorder(nicelabs, -order),
         y = estimate,
         ymin = conf.low,
         ymax = conf.high,
         colour = country
       )) +
  geom_hline(yintercept = 0) +
  geom_pointrange(position = position_dodge(width = 1/2)) +
  scale_colour_manual(values = c("gray0", "gray60")) +
  coord_flip() +
  labs(x = "", y = "OLS Estimate") +
  theme_minimal() +
  #labs(y = "(b) Norway (n = 1879)") +
  theme(
    axis.text = element_text(colour = "black",
                             size = 12),
    title = element_text(size = 14),
    axis.title.x = element_text(size = 12, color = 'black'),
    axis.line.x = element_line(),
    legend.position = "bottom"
  )

```

### Contolling for fairness perceptions - as reported in footnote 7 in manuscript
```{r, warning=FALSE, message=FALSE}
#Portugal
por_lm_acceptability_fairness <- lm(acceptability ~ frames + favorable_outcome + fairness, data = por_df)

#Norway
nor_lm_acceptability_fairness <- lm(acceptability ~ frames + favorable_outcome + fairness, data = nor_df)
```


## Supplementary appendix
### Appendix Table A1 - Portugal
```{r, message = FALSE, results= "asis"}
por_df %>%
   dplyr::select(feesopinion, frames, fairness, outcome_char, favorable_outcome, acceptability) %>%
   dfSummary(dfSummary.varnumbers = FALSE, plain.ascii = FALSE, style = "grid",
           dfSummary.graph.col = FALSE)
```

### Appendix Table A2 - Norway
```{r, message = FALSE, results= "asis"}
nor_df %>%
  mutate(oilopinion = ifelse(opinion == 1, "It should be permitted",
                                          ifelse(opinion == 2, "It should be prohibited", NA))) %>%
   dplyr::select(oilopinion, frames, fairness, outcome, favorable_outcome, acceptability) %>%
   dfSummary(dfSummary.varnumbers = FALSE, plain.ascii = FALSE, style = "grid",
           dfSummary.graph.col = FALSE)

```

### Appendix section B2 - Perceived fairness as mediator

```{r, warning=FALSE, message=FALSE, results="hide"}
# Portugal
#The mediation package doesn't deal with missigness, so here we restrict the dataset to cases without NAs
por_df_med <- por_df[complete.cases(por_df[,c('acceptability', 'frames', 'fairness')]),]

total_effect<-lm(acceptability ~ frames, por_df_med)
summary(total_effect)
iv_med<-lm(fairness ~ frames, por_df_med)
summary(iv_med)
med_dv<-lm(acceptability ~ fairness+frames, por_df_med) #Including IV here
summary(med_dv)
```

```{r, warning=FALSE, message=FALSE}
set.seed(1234)
results <- mediate(iv_med, med_dv, treat="frames", mediator="fairness")
summary(results)
```

```{r, warning=FALSE, message=FALSE, results="hide"}
# Norway
#The mediation package doesn't deal with missigness, so here we restrict the dataset to cases without NAs
nor_df_med <- nor_df[complete.cases(nor_df[,c('acceptability', 'frames', 'fairness')]),]

total_effect<-lm(acceptability ~ frames, nor_df_med)
summary(total_effect)
iv_med<-lm(fairness ~ frames, nor_df_med)
summary(iv_med)
med_dv<-lm(acceptability ~ fairness+frames, nor_df_med) #Including IV here
summary(med_dv)
```

```{r, warning=FALSE, message=FALSE}
set.seed(1234)
nor_results <- mediate(iv_med, med_dv, treat="frames", mediator="fairness")
summary(nor_results)
```


### Appendix Table B4
```{r, warning=FALSE, message=FALSE, results="hide"}
#Save tables as word-files
stargazer(por_lm_acceptability, por_lm_h4, por_lm_acceptability_fairness, nor_lm_acceptability, nor_lm_h4, nor_lm_acceptability_fairness,
          type = "html",
          star.char = c("*", "**", "***"),
          star.cutoffs = c(.05, .01, .001),
          style = "apsr",
          title = "Table #. The effect of framing and favorable outcome on outcome acceptability, complement to Figure 2",
          header = FALSE,
          covariate.labels = c("Legalistic", "Policy", "Favorable outcome", "Fairness"),
          single.row = TRUE,
          omit.stat = c("f", "ser", "rsq", "adj.rsq"),
          out = "acceptability_hypotheses.doc")

```

### Appendix table B5 - Missing values Portugal  

```{r, warning=FALSE, message=FALSE}
#Missing fairness
por_na_fairness <- lm(is.na(fairness) ~ frames, data = por_df)
por_na_fairness2 <- lm(is.na(fairness) ~ frames, data = por_df[por_df$frames != 'Partisan',])

#Missing acceptance
por_na_acceptance_frames <- lm(is.na(acceptability)~ frames, data = por_df)
por_na_acceptance_frames2 <- lm(is.na(acceptability) ~ frames, data = por_df[por_df$frames != 'Partisan',])
por_na_acceptance_favorableoutcome <- lm(is.na(acceptability)~ favorable_outcome, data = por_df)
```


```{r, warning=FALSE, message=FALSE, results="hide"}
stargazer(por_na_fairness, por_na_fairness2, por_na_acceptance_frames,por_na_acceptance_frames2, por_na_acceptance_favorableoutcome,
          type = "html",
          star.char = c("*", "**", "***"),
          star.cutoffs = c(.05, .01, .001),
          style = "apsr",
          title = "Table #. ",
          header = FALSE,
          covariate.labels = c("Legalistic", "Policy", "Favorable outcome"),
          single.row = TRUE,
          omit.stat = c("f", "ser", "rsq", "adj.rsq"),
          out = "por_missing.doc")
```

### Appendix table B6 - Missing values Norway
```{r, warning=FALSE, message=FALSE}
#Missing fairness
nor_na_fairness <- glm(is.na(fairness) ~ frames, data = nor_df, family = binomial)
nor_na_fairness2 <- glm(is.na(fairness) ~ frames, data = nor_df[nor_df$frames != 'Partisan',], family = binomial)
#Missing acceptance
nor_na_acceptance_frames <- glm(is.na(acceptability)~ frames, data = nor_df, family = binomial)
nor_na_acceptance_frames2 <- glm(is.na(acceptability) ~ frames, data = nor_df[nor_df$frames != 'Partisan',], family = binomial)
nor_na_acceptance_favorableoutcome <- glm(is.na(acceptability)~ favorable_outcome, data = nor_df, family = binomial)
```


```{r, warning=FALSE, message=FALSE, results="hide"}
stargazer(nor_na_fairness, nor_na_fairness2, nor_na_acceptance_frames,
          nor_na_acceptance_frames2,
          nor_na_acceptance_favorableoutcome,
          type = "html",
          star.char = c("*", "**", "***"),
          star.cutoffs = c(.05, .01, .001),
          style = "apsr",
          title = "Table #. ",
          header = FALSE,
          covariate.labels = c("Legalistic", "Policy", "Favorable outcome"),
          single.row = TRUE,
          omit.stat = c("f", "ser", "rsq", "adj.rsq"),
          out = "nor_missing.doc")


```

### Appendix Table B7 - Multiple imputation analysis
```{r, warning=FALSE, message=FALSE}
#Portugal
df_short<-por_df[,c('frames','fairness','favorable_outcome','acceptability')]
#NAs per variable
apply(df_short,2,function(x) sum(is.na(x)))

set.seed(1234)
df.mids<-mice(df_short, print=FALSE)
#Fairness model with multiple imputation
fairness_model<-lm.mids(fairness ~ frames, df.mids)
#Results from fairness model with multiple imputation
summary(pool(fairness_model))
#Acceptability model with multiple imputation
acceptability_model<-lm.mids(acceptability ~ frames + favorable_outcome, df.mids)
#Results from acceptability model with multiple imputation
summary(pool(acceptability_model))
```


```{r, warning=FALSE, message=FALSE}
#Norway
nor_df_short<-nor_df[,c('frames','fairness','favorable_outcome','acceptability')]
#NAs per variable
apply(nor_df_short,2,function(x) sum(is.na(x)))

set.seed(1234)
nor_df.mids<-mice(nor_df_short,print=FALSE)
#Fairness model with multiple imputation
nor_fairness_model<-lm.mids(fairness ~ frames, nor_df.mids)
#Results from fairness model with multiple imputation
summary(pool(nor_fairness_model))
#Acceptability model with multiple imputation
nor_acceptability_model<-lm.mids(acceptability ~ frames + favorable_outcome, nor_df.mids)
#Results from acceptability model with multiple imputation
summary(pool(nor_acceptability_model))
```

### Exploratory analysis: Is the effect of favorable outcome on acceptability perception conditioned by frames and fairness perceptions?
```{r, warning=FALSE, message=FALSE}
#Portugal interaction model
por_frames_outcome <- lm(acceptability ~ frames * favorable_outcome, data = por_df)
#Norway interaction model
nor_frames_outcome <- lm(acceptability ~ frames * favorable_outcome, data = nor_df)
```

### Make figure C1
```{r, warning=FALSE, message=FALSE}
por_frames_outcome_plot <-
  cat_plot(
    por_frames_outcome,
    pred = frames,
    modx = favorable_outcome,
    interval.geom = "linerange",
    colors = c("gray0", "gray60")
  ) +
  ggtitle("Portugal") +
  labs(y = "acceptance") +
  theme(legend.position = "bottom",
        legend.title = element_blank())

nor_frames_outcome_plot <-
  cat_plot(
    nor_frames_outcome,
    pred = frames,
    modx = favorable_outcome,
    interval.geom = "linerange",
    colors = c("gray0", "gray60")
  ) +
  ggtitle("Norway") +
  labs(y = "acceptance") +
  theme(legend.position = "bottom",
        legend.title = element_blank())

```

### Plot Figure C1
```{r frames-outcome, warning=FALSE, message=FALSE, echo=FALSE, dpi=300, fig.width=10, fig.height=10, fig.cap = "Interaction effect between framing and favorable outcome on acceptability perceptions. The upper part of the figure show Portguese results and the lower part show Norwegian results. Estimates are the predicted mean for different outcomes across different levels of frames. 95% confidence intervals enclose the estimates."}
(por_frames_outcome_plot)/
(nor_frames_outcome_plot)

```


### Appendix table C1
```{r, warning=FALSE, message=FALSE, results="hide"}
stargazer(por_frames_outcome, nor_frames_outcome,
           star.char = c("*", "**", "***"),
           star.cutoffs = c(.05, .01, .001),
           type = "html",
           digits = 3,
           style = "apsr",
           title = "Interaction effects frames and fairness perceptions, Portugal",
           covariate.labels = c("Legalistic", "Policy",
                                 "Favorable outcome", "Legalistic*favorable outcome",
                                "Policy*favorable outcome"
                                 ),
           header = FALSE,
           single.row = TRUE,
           omit.stat = c("f", "ser", "rsq", "adj.rsq"),
           out = "frames_ouctome_interactions.doc")


```

### Session info
```{r}
sessionInfo()
```

